<template>
<!--    回复信息-->
    <a-spin style="min-height: 400px;background-color: #fff" :spinning="loading">
        <a-card v-for="(cell, index) in replyList" :key="index">
            <a-form-model  :label-col="{ span: 3 }" :wrapper-col="{ span: 16 }">
                <a-row :gutter="24">
                    <a-col :md="12" :sm="12">
                        <a-form-model-item label="回复人：">
                            <a-input disabled v-model="cell.replyUserName"></a-input>
                        </a-form-model-item>
                    </a-col>
                    <a-col :md="12" :sm="12">
                        <a-form-model-item label="回复日期：">
                            <a-input disabled v-model="cell.replyDate"></a-input>
                        </a-form-model-item>
                    </a-col>
                </a-row>
            </a-form-model>
            <template v-for="item in cell.auditApprovalDTOS">
                <title-name :title="'回复' + item.nodeName + '信息'" :key="item.id" />
                <a-table
                        :columns="columns"
                        row-key="id"
                        :data-source="item.opinionDTOList"
                        :pagination="false"
                        bordered
                        :key="item.id"
                >
                    <template slot="approvalUserName">
                        {{item.approvalUserName}}
                    </template>
                </a-table>
                <div
                        class="file-list"
                        :key="item.id"
                >
                    <span>附件上传：</span>
                    <file-link style="margin-top: 0;" :fileList="item.fileInfoVOS" />
                </div>
            </template>
        </a-card>
    </a-spin>

</template>

<script>
  import { queryAuditApprovalListById } from '@/api/technical/reviewReply'
  import { columns } from '../model.js'

  export default {
    name: 'replyinfo',
    data() {
      return {
        replyList: [{fileInfoVOS: []}],
        columns,
        loading: false
      }
    },
    mounted(){
      this.getReplyMessage()
    },
    methods: {
      /**
       * @description: 获取变更信息
       * @return {void}
       */
      getReplyMessage(){
        this.loading = true
        //
        queryAuditApprovalListById(this.$route.query.replyId).then((res)=>{
          this.loading = false
          const versionNumber = this.$route.query.versionNumber
          if(res.code === this.SUCCESS_CODE){
            this.replyList = res.data.filter(item=>item.versionNumber == versionNumber)
          }else{
            this.replyList = []
          }
        }).finally(()=>{
          this.loading = false
        })
      }
    }
  }
</script>
<style lang="less" scoped>
    .file-list{
        display: flex;
        margin: 20px 0;
        align-items: center;
    }
</style>